package com.eshop.we.config;


import com.eshop.we.interceptor.CommonInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *  Interceptor config
 * 使用拦截器进行统一权限验证
 * @author
 * @create 2018-03-16 上午8:44
 **/
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(commonInterceptor()).addPathPatterns("/**").excludePathPatterns("/wxauto/login","/pay/ordernotifyresult");
    }



    @Bean
    CommonInterceptor commonInterceptor(){
        return new CommonInterceptor();
    }
}
